define (require, exports, module) ->
  module.exports =
    # // NODE环境
    # CONFIG = 
    #   "env" : "#{ENV}"
    # 获取终端类型
    getDeviceType:()->
      matchDict = [
        {
          key:/ipad/i
          value:"ipad"
        }
        {
          key:/iphone os/i
          value:"iphone os"
        }
        {
          key:/midp/i
          value:"midp"
        }
        {
          key:/rv:1.2.3.4/i
          value:"rv:1.2.3.4"
        }
        {
          key:/ucweb/i
          value:"ucweb"
        }
        {
          key:/android/i
          value:"android"
        }
        {
          key:/windows ce/i
          value:"windows ce"
        }
        {
          key:/windows mobile/i
          value:"windows mobile"
        }
      ]
      device_type = 'PC'
      sUserAgent = navigator.userAgent.toLowerCase()
      flag = false
      for md in matchDict
        key = sUserAgent.match(md.key)
        flag = (if _.isArray(key) then key[0] else key) == md.value
        if flag
          device_type = "PHONE"
          break
      return device_type

    # DEVICE =
    #   "device_type" : getDeviceType()
